package com.ruibang.glass.quality.controller;

import com.ruibang.glass.quality.domain.req.ColdDirectReq;
import com.ruibang.glass.quality.service.EveryHourColdDirectService;
import com.teaming.cloud.framework2.common.model.ResultBody;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * <p>
 * 冷端直投缺陷全检平均单板数量及曲线 前端控制器
 * </p>
 *
 * @author wujie
 * @since 2020-08-06
 */
@RestController
@RequestMapping("/api/clod/direct/hour")
@Api(value = "每小时冷端直投缺陷全检平均单板数量及曲线", tags = {"每小时冷端直投缺陷全检平均单板数量及曲线"})
public class EveryHourColdDirectController {

    @Autowired
    private EveryHourColdDirectService everyHourColdDirectService;

    @PostMapping("/queryEveryHourColdDirect")
    @ApiOperation(value = "查询每小时冷端直投缺陷", notes = "查询每小时冷端直投缺陷")
    public ResultBody queryEveryHourColdDirect(@RequestBody ColdDirectReq coldDirectReq) {
        return everyHourColdDirectService.queryEveryHourColdDirect(coldDirectReq);
    }

    @PostMapping("/queryCheckAverage")
    @ApiOperation(value = "全检平均单板数量及曲线", notes = "全检平均单板数量及曲线")
    public ResultBody queryCheckAverage(@RequestBody ColdDirectReq coldDirectReq) {
        return everyHourColdDirectService.queryCheckAverage(coldDirectReq);
    }

    @PostMapping("/queryDefect")
    @ApiOperation(value = "饼状图", notes = "饼状图")
    public ResultBody queryDefect(@RequestBody ColdDirectReq coldDirectReq) {
        return everyHourColdDirectService.queryDefect(coldDirectReq);
    }

    @PostMapping("/getPointDefectData")
    @ApiOperation(value = "点状图", notes = "点状图")
    public ResultBody getPointDefectData(@RequestBody ColdDirectReq coldDirectReq) {
        return everyHourColdDirectService.getPointDefectData(coldDirectReq);
    }
}
